<template>
  <kk-container
    pageBackground="#F1F2F3"
    footerBackground="#F1F2F3"
    title="公众号消息模拟测试"
    :isShowHeader="true"
  >
    <view class="answerTest">
      <up-input
        placeholder="请输入答疑id"
        border="surround"
        v-model="answerId"
        @change="change"
      ></up-input>
      <up-button
        style="margin-top: 20px"
        type="primary"
        text="跳转答疑详情"
        @tap="jumpDetail"
      ></up-button>
    </view>
  </kk-container>
</template>

<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import kkToast from "@/utils/kkToast";

const answerId = ref();

onLoad(() => {});

const jumpDetail = () => {
  if (!answerId.value) {
    kkToast.showToast("请输入答疑ID");
    return;
  }
  uni.navigateTo({
    url: `/pagesA/answer/detail?id=${answerId.value}`,
  });
};
</script>

<style lang="scss" scoped>
.answerTest {
  margin: 40rpx;
}
</style>
